package com.sitech.portal.report.dao.ibatis;

import com.sitech.ibnms.core.BaseIbnmsDao;
import com.sitech.ibnms.core.IPage;
import com.sitech.ibnms.core.PageForm;
import com.sitech.portal.report.dao.ITbSysModuleUseLogDao;
import com.sitech.portal.report.domain.TbSysModuleUseLog;
import com.sitech.portal.report.form.SysModuleUseCountForm;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2015/6/23.
 */
public class TbSysModuleUseLogDaoImpl extends BaseIbnmsDao implements ITbSysModuleUseLogDao{
    @Override
    public void addSysModuleUseLog(TbSysModuleUseLog log) {
        super.insert("addTbSysModuleUseLog", log);
    }

    @Override
    public IPage countModuleUseCount(PageForm pageForm) {
        return super.findPage("countTbSysModuleUseLogByModuleId",pageForm);
    }

    @Override
    public List<SysModuleUseCountForm> countModuleUseCountByTimeInterval(Date startDate, Date endDate, Integer topN, String orderWay) {
        Map<String, Object> map = new HashMap<String, Object>();
        Map<String, Integer> resultMap = new HashMap<String, Integer>();
        map.put("startDate", startDate);
        map.put("endDate", endDate);
        map.put("topN", topN);
        map.put("orderWay", orderWay);
        List list = super.query("countTbSysModuleUseLogTopNByTimeInterval", map);

        return list;
    }
}
